﻿#region File Description
//-----------------------------------------------------------------------------
//PayPeriod.cs
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Agile_E
{
    class PayPeriod
    {

        #region Fields

        List<DateTime> dates = new List<DateTime>();
        List<float> hours_worked = new List<float>();

        DateTime start;
        DateTime end;

        int pay_ID;

        #endregion

        #region Constructor

        public PayPeriod(DateTime s, DateTime e, int num)
        {
            pay_ID = num;

            start = s;
            end = e;

            DateTime temp = s;

            while (temp.CompareTo(e) < 0)
            {
                dates.Add(temp);
                hours_worked.Add(0);

                temp.AddDays(1);
            } 
        }

        #endregion

        #region Properties

        public DateTime StartDate
        {
            get { return start; }
            set { start = value; }
        }

        public DateTime EndDate
        {
            get { return end; }
            set { end = value; }
        }

        public int ID
        {
            get{ return pay_ID; }
            set{ pay_ID = value; }
        }

        public List<DateTime> Dates
        {
            get { return dates; }
        }

        public List<float> Hours
        {
            get { return hours_worked; }
            set { hours_worked = value; }
        }

        #endregion
    }
}
